import { defHttp } from '/@/utils/http/axios';
const baseAPi = '/GatewayManager/';

/**
 * @description: 获取查找模式
 */
export function getNodeSearchModes() {
  return defHttp.post({ url: `${baseAPi}getnodesearchmodes` });
}

/**
 * @description: 开始扫描
 */
export function startScanNode(data) {
  return defHttp.post({ url: `${baseAPi}startscannode`, data });
}

/**
 * @description: 停止扫描
 */
export function stopScanNode() {
  return defHttp.post({ url: `${baseAPi}stopscannode` });
}
/**
 * @description: 工程下载
 */
export function projectDownload(data) {
  return defHttp.post({ url: `${baseAPi}projectdownload`, data });
}
/**
 * @description: 重启工程
 */
export function restartIOTService(data) {
  return defHttp.post({ url: `${baseAPi}RestartIOTService`, data });
}

/**
 * @description: 添加节点
 */
export function addnode(data) {
  return defHttp.post({ url: `${baseAPi}addnode`, data });
}

/**
 * @description: 工程文件是否合法
 */
export function legalitytheproject(data) {
  return defHttp.post({ url: `${baseAPi}legalitytheproject`, data });
}

/**
 * @description: 远端工程是否在运行
 */
export function remoteprojectisrunning(data) {
  return defHttp.post({ url: `${baseAPi}remoteprojectisrunning`, data });
}
/**
 * @description: 工程上传
 */
export function projectuploading(data) {
  return defHttp.post(
    { url: `${baseAPi}projectuploading`, data, responseType: 'blob' },
    {
      isReturnNativeResponse: true,
      isDownLoadUrl: true,
    },
  );
}
/**
 * @description: 获取节点最新数据

 */
export function getupdatenode(data) {
  return defHttp.post({ url: `${baseAPi}getupdatenode`, data });
}

/**
 * @description: 获取服务器ip地址

 */
export function getipv4address() {
  return defHttp.post({ url: `${baseAPi}getipv4address` });
}
/**
 * @description: 软件更新

 */
export function softwareupdates(data) {
  return defHttp.post({ url: `${baseAPi}softwareupdates`, data });
}
/**
 * @description: 默认节点默认端口

 */
export function getnodesearchport() {
  return defHttp.post({ url: `${baseAPi}getnodesearchport` });
}
